<template>
  <div class="q-pa-md" style="max-width: 300px">
    <t-input
      filled
      v-model="model"
      label="Type here"
      bottom-slots
      :error="!isValid"
      hint="Max 3 characters"
    >
      <template v-slot:error> Please use maximum 3 characters. </template>
    </t-input>
  </div>
</template>

<script>
  import { computed, ref } from 'vue';

  export default {
    setup() {
      const model = ref('');

      return {
        model,
        isValid: computed(() => model.value.length <= 3),
      };
    },
  };
</script>
